<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script src="../js/vue.js"></script>
<div id="app">
  <cpn>
    <h2 slot="middle">标题</h2>
    <h2 slot="right">hahahah</h2>
  </cpn>
</div>
<template id="cpn">
  <div>
    <slot><span>左边</span></slot>
    <slot name="middle"><span>中间</span></slot>
    <slot name="right"><span>右边</span></slot>
  </div>

</template>
<script>
    const app = new Vue({
        el:'#app',
        data:{
            message:'hello vue',
        },
      components:{
          cpn:{
            template:'#cpn'
          }
      }

    })
</script>

</body>
</html>